package Experiment1;



import junit.framework.TestCase;
import java.util.ArrayList;
/**
 * Created by zhangyunqi on 2017/9/25.
 */

public class ArrayListDemoTest extends TestCase {

    ArrayList list = new ArrayList ();

    public void testIsEmpty() {

        assertEquals ( true, list.isEmpty () );

        list.add ( "My name is zhangyunqi" );

        assertEquals ( false, list.isEmpty () );

        list.remove ( "My name is zhangyunqi" );

        assertEquals ( true, list.isEmpty () );

    }

    public void testAdd() {

        list.add ( "实验1" );

        assertEquals ( "实验1", list.get ( 0 ) );
    }


    public void testRemove() {

        assertEquals ( true, list.isEmpty () );

        list.add ( "zhangyunqi" );

        list.remove ( "zhangyunqi" );

        assertEquals ( 0, list.size (  ) );
    }
}